package com.dimples.dd.system.convert;

import com.dimples.dd.common.pojo.PageResult;
import com.dimples.dd.system.model.entity.Oauth2AuthorizationDO;
import com.dimples.dd.system.model.vo.OAuth2AccessTokenPageVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

/**
 * @author zhongyj <1126834403@qq.com><br/>
 * @date 2024/8/29
 */
@Mapper(componentModel = "spring")
public interface Oauth2AuthorizationConvert {


    @Mappings({
            @Mapping(source = "registeredClientId", target = "clientId"),
            @Mapping(source = "principalName", target = "username"),
    })
    OAuth2AccessTokenPageVO entity2VO(Oauth2AuthorizationDO oauth2AuthorizationDO);

    PageResult<OAuth2AccessTokenPageVO> entity2Page(PageResult<Oauth2AuthorizationDO> doPageResult);
}

